import Vue from "vue";
import {
  Button,
  ConfigProvider,
  Pagination,
  Icon,
  Row,
  Col,
  Spin,
  Divider,
  Layout,
  Menu,
  FormModel,
  Breadcrumb,
  Space,
  Affix,
  Dropdown,
  PageHeader,
  Descriptions,
  Steps,
  Message,
  Notification,
  AutoComplete,
  Select,
  Cascader,
  Checkbox,
  DatePicker,
  Switch,
  Radio,
  Input,
  InputNumber,
  Tooltip,
  Rate,
  TimePicker,
  Transfer,
  Table,
  Tree,
  TreeSelect,
  Upload,
  Avatar,
  Badge,
  Calendar,
  Card,
  Carousel,
  Collapse,
  Comment,
  List,
  Empty,
  Popover,
  Statistic,
  Tabs,
  Tag,
  Alert,
  Modal,
  Drawer,
  Popconfirm,
  Progress,
  Result,
  Skeleton,
  Anchor,
  BackTop
} from "ant-design-vue"; // 按需引入 ant-design-vue 组件
import VueDraggableResizable from "vue-draggable-resizable"; //table 可伸缩列
import App from "./App.vue";
import router from "./router";
import store from "./store";
//引入i18n
import VueI18n from "vue-i18n";
import LangENUS from "./common/language/en-us";
import LangZHCN from "./common/language/zh-cn";

//引入自定义图标
import iconFront from "./assets/iconfonts/iconfont.js";

/*
  注册引入的组件
*/
//按钮
Vue.use(Button);
Vue.use(VueI18n);
Vue.component(ConfigProvider.name, ConfigProvider);
//分页
Vue.component(Pagination.name, Pagination);
//图标
Vue.component(Icon.name, Icon);
//栅格
Vue.component(Row.name, Row);
Vue.component(Col.name, Col);
Vue.component(Spin.name, Spin);
//分隔符
Vue.component(Divider.name, Divider);
//布局容起
Vue.component(Layout.name, Layout);
Vue.component(Layout.Header.name, Layout.Header);
Vue.component(Layout.Content.name, Layout.Content);
Vue.component(Layout.Sider.name, Layout.Sider);
Vue.component(Layout.Footer.name, Layout.Footer);
//菜单
Vue.component(Menu.name, Menu);
Vue.component(Menu.Item.name, Menu.Item);
Vue.component(Menu.SubMenu.name, Menu.SubMenu);
Vue.component(Menu.Divider.name, Menu.Divider);
//面包屑
Vue.component(Breadcrumb.name, Breadcrumb);
Vue.component(Breadcrumb.Item.name, Breadcrumb.Item);
Vue.component(Breadcrumb.Separator.name, Breadcrumb.Separator);
// 间距
Vue.component(Space.name, Space);
//固钉
Vue.component(Affix.name, Affix);
//下拉菜单
Vue.component(Dropdown.name, Dropdown);
//页头
Vue.component(PageHeader.name, PageHeader);
//步骤条
Vue.component(Steps.name, Steps);
Vue.component(Steps.Step.name, Steps.Step);
//自动完成
Vue.component(AutoComplete.name, AutoComplete);
//下拉框
Vue.component(Select.name, Select);
Vue.component(Select.Option.name, Select.Option);
//级联选择
Vue.component(Cascader.name, Cascader);
//多选框
Vue.component(Checkbox.name, Checkbox);
Vue.component(Checkbox.Group.name, Checkbox.Group);
//日期选择器DatePicker
Vue.component(DatePicker.name, DatePicker);
Vue.component(DatePicker.MonthPicker.name, DatePicker.MonthPicker);
Vue.component(DatePicker.RangePicker.name, DatePicker.RangePicker);
Vue.component(DatePicker.WeekPicker.name, DatePicker.WeekPicker);
//form表单
Vue.component(FormModel.name, FormModel);
Vue.component(FormModel.Item.name, FormModel.Item);
//开关
Vue.component(Switch.name, Switch);
//单选框
Vue.component(Radio.name, Radio);
Vue.component(Radio.Group.name, Radio.Group);
//输入框
Vue.component(Input.name, Input);
Vue.component(Input.Group.name, Input.Group);
Vue.component(Input.TextArea.name, Input.TextArea); //文本域
Vue.component(Input.Search.name, Input.Search);
Vue.component(Input.Password.name, Input.Password);
Vue.component(Input.Group.name, Input.Group);
Vue.component(Input.Group.name, Input.Group);
Vue.component(InputNumber.name, InputNumber);

//文字提示气泡框
Vue.component(Tooltip.name, Tooltip);
//评分
Vue.component(Rate.name, Rate);
//时间选择器
Vue.component(TimePicker.name, TimePicker);
//穿梭框
Vue.component(Transfer.name, Transfer);
//表格
Vue.component(Table.name, Table);
Vue.component(Table.Column.name, Table.Column);
Vue.component(Table.ColumnGroup.name, Table.ColumnGroup);
//结构树下拉选择
Vue.component(TreeSelect.name, TreeSelect);
//结构树
Vue.component(Tree.name, Tree);
//上传组件
Vue.component(Upload.name, Upload);
//头像
Vue.component(Avatar.name, Avatar);
//徽章
Vue.component(Badge.name, Badge);
//日历
Vue.component(Calendar.name, Calendar);
//卡片
Vue.component(Card.name, Card);
Vue.component(Card.Grid.name, Card.Grid);
Vue.component(Card.Meta.name, Card.Meta);
//走马灯
Vue.component(Carousel.name, Carousel);
//折叠面板
Vue.component(Collapse.name, Collapse);
Vue.component(Collapse.Panel.name, Collapse.Panel);
//Comment评论
Vue.component(Comment.name, Comment);
//列表组件
Vue.component(List.name, List);
Vue.component(List.Item.name, List.Item);
Vue.component(List.Item.Meta.name, List.Item.Meta);

//描述列表
Vue.component(Descriptions.name, Descriptions);
Vue.component(Descriptions.Item.name, Descriptions.Item);
//空状态
Vue.component(Empty.name, Empty);
//气泡卡片
Vue.component(Popover.name, Popover);
//统计数值
Vue.component(Statistic.name, Statistic);
//支持可伸缩列
Vue.component("vue-draggable-resizable", VueDraggableResizable);
//标签页
Vue.component(Tabs.name, Tabs);
Vue.component(Tabs.TabPane.name, Tabs.TabPane);
//标签
Vue.component(Tag.name, Tag);
// 警告提示
Vue.component(Alert.name, Alert);
//模态框
Vue.component(Modal.name, Modal);
//抽箱
Vue.component(Drawer.name, Drawer);
//气泡提示框
Vue.component(Popconfirm.name, Popconfirm);
//进度条
Vue.component(Progress.name, Progress);
//反馈结果展示
Vue.component(Result.name, Result);
//骨架屏幕，占位
Vue.component(Skeleton.name, Skeleton);
//描点
Vue.component(Anchor.name, Anchor);
//返回顶部
Vue.component(BackTop.name, BackTop);

//提示框全局配置
Vue.prototype.$message = Message;
Vue.prototype.$notification = Notification;

Message.config({
  duration: 2, // 持续时间
  top: `100px`, // 到页面顶部距离
  maxCount: 2 // 最大显示数, 超过限制时，最早的消息会被自动关闭
});

Notification.config({
  placement: 'topRight',
  bottom: '50px',
  duration: 1,
});


const i18n = new VueI18n({
  locale: "zh-cn",
  messages: {
    "en-us": LangENUS,
    "zh-cn": LangZHCN
  }
});

const myicon = Icon.createFromIconfontCN({
  scriptUrl: iconFront
});
//引用
Vue.component("my-icon", myicon);

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount("#app");